<?php
#+------------------------------------------------------------------
#| 普通的。
#+------------------------------------------------------------------
#| Author:Janmas Cromwell <janmas-cromwell@outlook.com>
#+------------------------------------------------------------------
namespace form\element\form\traits;

trait Options
{
    protected $options = [];

    public function options($options): self
    {
        $this->options = $options;
        return $this;
    }

    protected function getOptions(): string
    {
        return is_array($this->options) ? json_encode($this->options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) : $this->options;
    }
}